package com.hzsai.mininotecaller.common;

import lombok.Data;

import java.io.Serializable;


/**
 * hzsai 2020/1/14
 * usage:
 **/
@Data
public class ResponseRe implements Serializable{

    private int code;
    private String message;
    private Object data;

    // 双重锁
//    public static ResponseRe getInstance() {
//        if (instance == null) {
//            synchronized (ResponseRe.class) {
//                if (instance == null) {
//                    instance = new ResponseRe();
//                }
//            }
//        }
//        return instance;
//    }

    private ResponseRe(int code, String message, Object obj) {
        this.code = code;
        this.message = message;
        this.data = obj;
    }

    public static ResponseRe success(int code, String message, Object obj) {
        return new ResponseRe(code, message, obj);
    }

    public static ResponseRe fail(int code, String message, Object obj) {
        return new ResponseRe(code, message, obj);
    }
}
